<template>
  <div class="chartBox">
    <div class="chartBox__top">
      订单统计
    </div>

    <div class="chartBox__button">
      <div class="left">

        <div class="left_top">
          <span>本月订单总数</span>
          <p>2846</p>
          <span> 
            <b style="color:#63d7c6">
              <el-icon><Top /></el-icon>
            10%</b> 
            同比上月
          </span>
        </div>

        <div class="left_bottom">
          <span>本周订单总数</span>
          <p>8645</p>
          <span> 
            <b style="color:#fe5868">
            <el-icon><Bottom /></el-icon>
            10%
          </b> 同比上周
          </span>
        </div>

      </div>


      <div class="right">
        <div class="btn_time">
        <span>
        <el-radio-group  label="size control" >
                <el-radio-button type="primary">今日</el-radio-button>
                <el-radio-button  type="primary">本周</el-radio-button>
                <el-radio-button type="primary">本月</el-radio-button>
            </el-radio-group>
       </span>
       <span>
        <el-date-picker
        type="daterange"
        range-separator="--"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        style="width: 300px;margin-left: 50px"
      />
       </span>
       </div>
     

        <div id="sell" ref="myChartRef" style="width: 85%;height:400px; background-color: white;">
         
        </div>
       
      </div>

    </div>
</div>
</template>

<script setup>
import { onMounted, defineProps, ref } from 'vue';
import { Top,Bottom} from '@element-plus/icons-vue';
import * as echarts from 'echarts';

const props = defineProps(['option'])
const myChartRef = ref()

onMounted(() => {
  let myChart = echarts.init(myChartRef.value);
  let option;
  option = props.option
  option && myChart.setOption(option);
})


</script>

<style lang="scss" scoped>
.chartBox {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 1230px;
  height: 500px;
  border-radius: 15px;
  background-color: #fff;

  .chartBox__top {
    width: 100%;
    height: 50px;
    padding-left: 10px;
    box-sizing: border-box;
    line-height: 50px;
    color: #333333;
    font-weight: bold;

  }

  .chartBox__button {
    display: flex;
    background-color: #fff;
    width: 100%;
    height: 450px;
    border-top: 5px solid #f8f8f8;
 

    .left {
      padding: 40px 0 0 20px;
    box-sizing: border-box;
      width: 12%;
      height: 450px;
      border-right: 2px solid #f8f8f8;
      span{
        font-size: 12px;
        color: #9a9a9b;
      }
      p{
        font-size: 26px;
        color: #1485fe;
        line-height: 0px;
      }
      .left_top{
       height: 100px;
       margin-bottom: 25px;
      }
    }

    .right {
      width: 1000px;
      flex: 1;
   
      .btn_time{
        display: flex; 
        justify-content: center;
        margin-top: 10px;
      }
    }
  }
}
</style>